#include <iostream>
using namespace std;

const int N = 100010;
int n, m;
int b[N];

void insert(int a[], int l, int r, int c)
{
    a[l] += c;
    a[r + 1] -= c;
    return;
}

int main()
{
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= n; ++i)
    {
        int k;
        scanf("%d", &k);
        insert(b, i, i, k);
    }
    while (m--)
    {
        int l, r, c;
        scanf("%d%d%d", &l, &r, &c);
        insert(b, l, r, c);
    }
    for (int i = 1; i <= n; ++i)
        printf("%d ", b[i] += b[i - 1]);
    return 0;
}